package com.zoroki.student_score_system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zoroki.student_score_system.domain.College;
import com.zoroki.student_score_system.service.CollegeService;
import com.zoroki.student_score_system.mapper.CollegeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【college】的数据库操作Service实现
* @createDate 2025-06-30 12:49:21
*/
@Service
public class CollegeServiceImpl extends ServiceImpl<CollegeMapper, College>
    implements CollegeService{
    @Autowired
    private CollegeMapper collegeMapper;

    @Override
    public List<College> getAllCollege() {
        return collegeMapper.selectList(null);
    }

    @Override
    public College getCollegeById(int id) {
        return collegeMapper.selectById(id);
    }

    @Override
    public boolean addCollege(College college) {
        return collegeMapper.insert(college) > 0;
    }

    @Override
    public boolean updateCollege(College college) {
        return collegeMapper.updateById(college) > 0;
    }

    @Override
    public boolean deleteCollege(int id) {
        return collegeMapper.deleteById(id) > 0;
    }
}




